package com.cc.app.ui;

import com.cc.app.game.Game;

/**
 * @Author Zaifeng
 * @Create 2017/7/13 0013
 * @Description Content
 */

public class GameInfo implements Game {

    public static final String GAME_MODE_NORMAL = "gameModeNormal";
    public static final String GAME_MODE_EXCHANGE = "gameModeExchange";

    public static final GameInfo ONE = new GameInfo();

    private int level = 1;

    private String mode = GAME_MODE_NORMAL;

    private int image;

    @Override
    public void addLevel() {
        if (level >= 4)
            return;

        level++;
    }

    @Override
    public void reduceLevel() {
        if (level <= 1)
            return;

        level--;
    }

    public boolean setLevel(int level) {
        if (level <= 1 || level >= 4)
            return false;

        this.level = level;
        return true;
    }

    public boolean isTopLevel() {
        return this.level >= 4;
    }


    public int getLevel() {
        return level;
    }

    public int getCount() {
        return level + 2;
    }

    public String getMode() {
        return mode;
    }

    public int getImage() {
        return image;
    }

    public boolean isNormalMode() {
        return mode.equals(GAME_MODE_NORMAL);
    }

    @Override
    public void changeMode(String gameMode) {
        this.mode = gameMode;
    }

    @Override
    public void changeImage(int res) {
        this.image = res;
    }
}
